package com.bangbang.service.impl;

import com.bangbang.pojo.TbGroupCourse;
import com.bangbang.mapper.TbGroupCourseMapper;
import com.bangbang.service.ITbGroupCourseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 拼团课程商品信息表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-08-13
 */
@Service
public class TbGroupCourseServiceImpl extends ServiceImpl<TbGroupCourseMapper, TbGroupCourse> implements ITbGroupCourseService {

    @Autowired
    private TbGroupCourseMapper groupCourseMapper;

    @Override
    public void creatGroupCourse(TbGroupCourse groupCourse) {
        groupCourseMapper.insertResultId(groupCourse);
    }

    @Override
    public List<TbGroupCourse> selectGroupCourse() {
        List<TbGroupCourse> tbGroupCourses = groupCourseMapper.selectList(null);
        if(tbGroupCourses == null){
            return null;
        }
        return tbGroupCourses;
    }
}
